<ion-header>
    <ion-toolbar>
        <img class="back_img" src="..\assets\img\返回.png" slot="start" (click)="goBack(courseId)">
        <ion-title>练习列表</ion-title>
        <img class="add_img" src="..\assets\img\添加.png" (click)="addExercise(courseId)" slot="end">
    </ion-toolbar>
</ion-header>

<ion-content>
    <!-- 搜索框 -->
    <ion-toolbar style="margin-top: 1rem;">
        <ion-searchbar placeholder="请输入搜索关键词" [(ngModel)]="keywords">
        </ion-searchbar>
        <ion-buttons slot="end">
            <ion-button (click)="doSearch()" color="dark">
                搜索
            </ion-button>
        </ion-buttons>
    </ion-toolbar>
    <!-- 历史记录 -->
    <!-- <div class="search_content" *ngIf="flag && exeHistoryList.length>0" padding >
        <div class="history">
            <h5 class="search_title">历史记录</h5>
            <div class="btn_Delete">
                <ion-icon name="trash" slot="end" color="danger" (click)="deleteHistory(exeHistoryList)"></ion-icon>
            </div>
            <p>
                <span *ngFor="let item of exeHistoryList;let key=index;" (press)="removeHistory(key)" (tap)="goSearch(item)"> 
                  {{item}}
                </span>
            </p>
        </div>
    </div> -->

    <!-- 练习列表 -->
    <ion-card>
        <ion-list *ngFor="let item of ExerciseList" key="item.id">
            <ion-item-sliding>
                <ion-item (press)="deleteExercise(item.id)" (tap)="editExercise(item.id)">
                    <ion-icon name="book" color="secondary"></ion-icon>{{item.name}}
                </ion-item>
                <ion-item-options side="end">
                    <ion-item-option color="success" (click)="readExercise(item.id)">阅卷</ion-item-option>
                    <!-- <ion-item-option color="danger" (click)="deleteExercise(item.id)">删除</ion-item-option> -->
                </ion-item-options>
            </ion-item-sliding>
        </ion-list><br>
    </ion-card>
</ion-content>